% scribe: Saurabh Amin
% lastupdate: 6 December 2005
% lecture: 23
% references: Durrett, sections 3.1 and 4.2
% title: Stopping Times and Martingales
% keywords: unfair coin tossing game, Wald's second equation
% end

\documentclass[12pt, letterpaper]{article} 
\include{macros}

\usepackage{floatflt}

%\def\qed{\ifmmode\Box\else$\Box$\fi}

\begin{document}

\lecture{23}{Stopping Times and Martingales: Examples}{Saurabh Amin}{amins@berkeley.edu}

These notes are the continuation of the notes scribed by Moorea Brega.
References: \cite{durrett}, sections 3.1 and 4.2.

\section{Stopping Times and Martingales: Examples}
% keywords: unfair coin tossing game, Wald's second equation
% end

\begin{example}[\textbf{Unfair coin tossing game}]
%unfair coin tossing game
Suppose that we have a biased coin, with probability $p$ of heads, $q=1-p$ of tails. Let us define i.i.d. random variables $X_i$ by $X_i = 1$ when the $i^{th}$ coin toss is a head, and $-1$ when the $i^{th}$ coin toss is a tail. Suppose that $S_{0}=a$ where $a$ is a positive integer, and let $S_n=S_0+X_1+\ldots+X_n$. Let $T=\inf\{n:S_{n}=0 \mbox{ or }b\}$ for $b>0$ an integer. We argue that $\P(T<\infty)=1$ and we want to find $\P(S_T=b)$ and $\P(S_T=0)$.
\end{example}

\begin{proof} Note that $S_n$ is \emph{not} a martingale and so the idea is to find a suitable $h(x)$ such that $h(S_n)$ is a martingale. If $h(S_n)$ is to be a martingale, we must have that $h(x)=ph(x+1)+qh(x-1)$ because given $S_n$, $S_{n+1}$ is $S_n+1$ with probability $p$ and $S_n-1$ with probability $q$. Consider $h(x)=z^x$ where $z$ will be determined shortly. From the above equation, we have $z^{x}=pz^{x+1}+qz^{x-1}$ and in particular, $z=pz^{2}+q$. Alternatively, compute $\E[z^{S_{n+1}}|\mathcal{F}_n]=z^{S_n}\E[z^{X_{n+1}}|\mathcal{F}_n]$ $=z^{S_n}[pz^{1}+qz^{-1}]$. If $z^{S_n}$ is a martingale, $\E[z^{S_{n+1}}|\mathcal{F}_n]=z^{S_n}$ and so $z=pz^{2}+q$. The roots of the quadratic equations are $1$ (trivial) and $(q/p)$. So we conclude that $(q/p)^{S_{n}}$ is a martingale.  

For $0\leq n \leq T=\inf\{n:S_n=0$ or $b\}$, we observe that $(q/p)^{S_n}$ is bounded between $(q/p)^{0}$ and $(q/p)^{b}$, so $(q/p)^{S_{n\wedge T}}$ is a bounded martingale. Easily, $\P(T<\infty)=1$ and as $n\rightarrow\infty$, $S_{n\wedge T}\rightarrow S_T$, so $(q/p)^{S_{n\wedge T}}\rightarrow (q/p)^{S_{T}}$ which implies that $\E[(q/p)^{S_{T}}]=(q/p)^{a}$, where $S_0=a$. Therefore,
\[
\P(S_{T}=b)(q/p)^{b}+\P(S_{T}=0)(q/p)^{0}=(q/p)^{a}.
\] 
We also have 
\[
\P(S_{T}=b)+\P(S_{T}=0)=1.
\]
Solving these two equations, we  obtain 
\[
\P(S_{T}=b)=\frac{(q/p)^{a}-1}{(q/p)^{b}-1}
\]
and 
\[
\P(S_T=0)=\frac{(q/p)^{b}-(q/p)^{a}}{(q/p)^{b}-1}.
\]
Note that the two equations are linearly dependent for $p=q$ but we have already worked out the formula for this case in the previous lecture.
\end{proof}

\begin{example}[\textbf{Wald's second equation}] Let $X_1, X_2,\ldots$ be i.i.d.\ with $\E X_n=0$ and $\E X_n^{2}=\sigma<\infty$. If $T$ is a stopping time with $\E T<\infty$ then show that $\E S_T^{2}=\sigma^{2}\E T$.
\end{example}
% Walds second identity

\begin{proof} Recall that $\mathcal{F}_n=\sigma(X_1,\ldots,X_n)$.  Let $M_n:=S_n^{2}-n\sigma^{2}$, where $\sigma^{2}=\E[X^2]$. Check that $M_n$ is a 
martingale:
%
\begin{eqnarray*}
\E[M_{n+1}|\mathcal{F}_n] &=& \E[S_{n+1}^2-(n+1)\sigma^{2}|\mathcal{F}_n]\\
&=& \E[S_{n}^{2}+2X_{n+1}S_n+X_{n+1}^{2}-(n+1)\sigma^{2}|\mathcal{F}_{n}]\\
&=& S_{n}^{2}-n\sigma^{2} \\
&=& M_n.
\end{eqnarray*}

First consider the case of a bounded stopping time $T$. We know $0=\E[M_0]=\E[M_T]=\E[S_T^2-T\sigma^{2}]$. Therefore, $\E[S_T^2]=\E[T]\sigma^{2}$ if $\P(T\leq N)=1$ for some non-random $N<\infty$. 

We now look at the general case when $T$ is unbounded. Consider $T\wedge n$ instead of $T$. We have 
$\E[S_{T\wedge n}^{2}]=\E[T\wedge n]\sigma^2$ for every $n=1,2,3,\ldots$. Let $n\rightarrow\infty$. Since $T\wedge n \uparrow 
T$ as $n$ increases, $\E[T\wedge n]\uparrow \E[T]<\infty$ (by assumption). Also we know that $S_{T\wedge n}$ is a martingale (because $S_n, n=0,1,\ldots$ is a martingale). However, since a martingale in $L^{2}$ has orthogonal increments only diagonal terms add up and hence $\E[S_{T\wedge n}^{2}]$ is increasing in $n$. We now argue that $\E[S_{T\wedge n}^{2}]$ increases to $\E[S_T^2]$. Since $\E[S_{T\wedge n}^{2}]=\E[T\wedge n]\sigma^{2}<\sigma^2 \E[T]<\infty$, we conclude that $S_{T\wedge n}$ is bounded in $L^{2}$. Therefore, by boundedness and orthogonality property, $S_{T\wedge n}\in L^2$ converges to some limit in $L^2$. However, we know that $S_{T\wedge n}\rightarrow S_T$ a.s.  Therefore $\E[S_T^2]=\E[T]\sigma^2$. 
\end{proof}
\bibliographystyle{plain}
\bibliography{../books.bib}

\end{document}

